﻿using System;
using EditoneLib.Annotations;
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace EditoneLib
{
    public abstract partial class BaseTrack
    {
        private TrackColor _color;
        private string _name = "Track";

        protected BaseTrack()
        {
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public TrackColor Color
        {
            get { return _color; }
            set
            {
                _color = value;
                OnPropertyChanged();
            }
        }

        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                OnPropertyChanged();
            }
        }

        public abstract Type[] SupportedClipTypes { get; }

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}